{include file='public/header' /}

 <!-- 配置文件 -->

<script src="__ROOT__/static/admin/utf8-php/ueditor.config.js" type="text/javascript"></script>

<!-- 编辑器源码文件 -->

<script src="__ROOT__/static/admin/utf8-php/ueditor.all.js" type="text/javascript"></script>
<body>

    <div class="layui-fluid">

        <div class="layui-row">

            <form class="layui-form " enctype="multipart/form-data" id="file" style="margin: 50px;">

                 <div class="layui-form-item">
                    <fieldset class="layui-elem-field">
                    <legend>预付定金</legend>

                    <div style="padding: 20px 50px;">

                        <input type="text" name="price" lay-verify="price" autocomplete="off" placeholder="请设置预付定金" class="layui-input" value="{$info.price}">

                    </div>

                    </fieldset>

                </div>



                <div class="layui-form-item" style="margin-top: 50px;">
                    <fieldset class="layui-elem-field">
                    <legend>客服电话</legend>

                    <div style="padding: 20px 50px;">

                        <input type="text" name="phone" autocomplete="off" placeholder="请设置客服电话" class="layui-input" value="{$info.phone}">

                    </div>
                    </fieldset>

                </div>
              


              <div class="layui-form-item" style="margin-top: 50px;">
                    <fieldset class="layui-elem-field">
                    <legend>检测报告页眉内容</legend>

                    <div style="padding: 20px 50px;">
                        <textarea placeholder="请输入检测报告页眉内容" class="layui-textarea" name="header">{$info.header}</textarea>
                    </div>
                    </fieldset>

              </div>
                

                <div class="layui-form-item" style="margin-top: 50px;">
                    <fieldset class="layui-elem-field">
                    <legend>重大事故车描述</legend>
                        <div style="padding: 20px 50px;">
                          <textarea placeholder="请输入事故车描述" class="layui-textarea" name="shigu">{$info1.shigu}</textarea>
                        </div>
                    </fieldset>

                </div>



                <div class="layui-form-item" style="margin-top: 50px;">
                    <fieldset class="layui-elem-field">
                    <legend>水泡车描述</legend>
                        <div style="padding: 20px 50px;">
                          <textarea placeholder="请输入水泡车描述" class="layui-textarea" name="shuipao">{$info1.shuipao}</textarea>
                        </div>
                    </fieldset>

                </div>



                 <div class="layui-form-item" style="margin-top: 50px;">
                    <fieldset class="layui-elem-field">
                    <legend>火烧车描述</legend>
                        <div style="padding: 20px 50px;">
                          <textarea placeholder="请输入火烧车描述" class="layui-textarea" name="huoshao">{$info1.huoshao}</textarea>
                        </div>
                    </fieldset>

                </div>




                <div class="layui-form-item" style="margin-top: 50px;">
                    <fieldset class="layui-elem-field">
                    <legend>预付定金说明</legend>
                        <div style="padding: 20px 50px;">
                          <div class="field col-10">

                              <textarea id="container" name="paytext" style="height:300px" type="text/plain">{$info.paytext}</textarea>

                              <!-- 实例化编辑器 -->

                              <script type="text/javascript">var ue = UE.getEditor('container')</script>

                          </div>
                        </div>
                    </fieldset>

                </div>





                <div class="layui-form-item" style="margin-top: 50px;">
                    <fieldset class="layui-elem-field">
                    <legend>车辆检测委托协议</legend>
                        <div style="padding: 20px 50px;">
                          <div class="field col-10">

                              <textarea id="container1" name="xieyi" style="height:300px" type="text/plain">{$info.xieyi}</textarea>

                              <!-- 实例化编辑器 -->

                              <script type="text/javascript">var ue = UE.getEditor('container1')</script>

                          </div>
                        </div>
                    </fieldset>

                </div>





                
                <div class="layui-form-item">

                    <button class="layui-btn" id="submitBtn" lay-filter="add" lay-submit="" type="submit">

                        更新信息

                    </button>

                </div>

            </form>

        </div>

    </div>




    <script>

        layui.config({
            base: '__ROOT__/static/admin/lib/layui/lay/modules/',
        })
        // 只需要引入multiSelect模块即可
        layui.use(['multiSelect'],function() {
            
        });

        layui.use(['form', 'layer', 'upload'], function() {

            $ = layui.jquery;

            var form = layui.form

            ,layer = layui.layer

            ,upload = layui.upload;
            
            //自定义验证规则

            
        });



        //获取form表单的节点
          fileEle = document.getElementById('file');

          arr = [];

          //把value的值拿出来

          valEle = '';

          nulEle = '';


          $("#file").on("submit",function(){

            //阻止form默认提交
            var evt = event;

            evt.preventDefault();

            //得到formData

            var formData = new FormData($(this)[0]);

            // 获取分类


            $.ajax({

              url:"{:url('Set/index')}",

              type:"post",

              async: false,

              cache: false,

              contentType: false,

              processData: false,

              data:formData,

              success:function(data){

                if (data == 1) {

                  layer.msg('更新成功', {icon: 1,time: 1500});

                  setTimeout(function(){
                    //刷新父页面
                    window.location.reload(); 

                  },1500);


                }else if (data == 0){

                  layer.msg('更新失败', {icon: 2,time: 1500});

                }
                

              }

            })

          })

    </script>

</body>

